import axios from "axios" 

function GetData(url,info){
   const Dataurl = "api" + url
   return new Promise (function(resolve,reject){
        axios.get(Dataurl,info)
        .then(function(res){
            resolve(res)
        })
        .catch(function(error){
            reject(error)
        })
    })
}
function getDetailData(url,info){
   const Dataurl = "api" + url
   return new Promise (function(resolve,reject){
        axios.post(Dataurl,info)
        .then(function(res){
            resolve(res.data.message)
        })
        .catch(function(error){
            reject(error)
        })
    })
}

export {
    GetData,
    getDetailData
}